package com.gzbugu.polytechsasia.dao;

import java.sql.SQLException;

import com.gzbugu.polytechsasia.vo.Article;

/**
 * Article dao interface
 * 
 * @author gauze
 * 
 */
public interface IArticleDAO {

	/**
	 * 保存
	 * 
	 * @param article
	 *            article instance
	 * @throws Exception
	 */
	public abstract void save(Article article) throws Exception;

	/**
	 * 删除
	 * 
	 * @param article
	 *            article instance
	 * @throws Exception
	 */
	public abstract void delete(Article article) throws Exception;

	/**
	 * 查询
	 * 
	 * @param id
	 *            article id
	 * @return article instance
	 * @throws SQLException
	 */
	public abstract Article findById(int id) throws SQLException;

	/**
	 * 更新
	 * 
	 * @param article
	 *            article instance
	 * @throws Exception
	 */
	public abstract void update(Article article) throws Exception;

	/**
	 * 保存或更新（不存在时保存，存在时更新）
	 * 
	 * @param article
	 *            article instance
	 * @throws SQLException
	 * @throws Exception
	 */
	public abstract void saveOrUpdate(Article article) throws SQLException,
			Exception;

}